<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>filter</title>
  <script src="/vue.js"></script>
  <script src="https://cdn.bootcdn.net/ajax/libs/moment.js/1.0.0/moment.js"></script>
</head>
<body>
  <div id="root">
    日期：{{date | cn}}
    价格：{{yuan | y}}
  </div>
  <script>
    var vm = new Vue({
      el: '#root',
      data: {
        date: '2020-10-16',
        yuan: 900
      },
      filters: {
        cn(value) {
          return moment(value).format('YYYY年MM月D日')
        },
        y(value) {
          return '￥' + value
        }
      }
    })
  </script>
</body>
</html>